﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ChemicalEquilibrium
{
    public class EnergyTransform
    {
        Queue<Reactant> As, A_s, Bs, B_s;

        public EnergyTransform(Queue<Reactant> As, Queue<Reactant> A_s, Queue<Reactant> Bs, Queue<Reactant> B_s)
        {
            this.As = As;
            this.A_s = A_s;
            this.Bs = Bs;
            this.B_s = B_s;
        }

        /// <summary>
        /// A激活B_,A失活为A_,B_激活为B
        /// </summary>
        public void Activate()
        {
            for (int i = 0; i < this.As.Count; i++)
            {
                if (this.As.Count == 0 || this.B_s.Count == 0) break;

                this.A_s.Enqueue(this.As.Dequeue());
                this.Bs.Enqueue(this.B_s.Dequeue());
            }
        }

    }
}
